package com.lxh.lxhcrm.model.pojos;


import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * 销售员行动记录表
 */
@Entity
@Table(name = "action_record", schema = "lxh_crm", catalog = "")
public class ActionRecord {
    private int actionRecordId;
    private Date actionDate;
    private String actionDetail;
    private Integer isContact;             //暂不联系   1 true checkbox勾选  0 false checkbox不勾选
    private Date nextContactTime;
    private String aboutDocument;
    private String remarks;
    private String othersRecord;
    private Integer zan;
    private Integer oppoId;
    private Customer customer;                  //客户  多对一
    private Contact contact;                    //联系人 一对一 （业务员在行动中联系客户某位联系人）
    private Emp emp;                            // 业务员 一对一
    private ActionType actionType;              /*员工大致的行动类型  多对一*/
    private List<BehaviorRecord> behaviorRecordList;      /*客户对应行动  一对多*/

    @ManyToOne
    @JoinColumn(name = "contact_id", referencedColumnName = "contact_id")
    public Contact getContact() {
        return contact;
    }

    public void setContact(Contact contact) {
        this.contact = contact;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @OneToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "emp_id")
    public Emp getEmp() {
        return emp;
    }

    public void setEmp(Emp emp) {
        this.emp = emp;
    }

    @ManyToOne
    @JoinColumn(name = "action_type_id", referencedColumnName = "action_type_id")
    public ActionType getActionType() {
        return actionType;
    }

    public void setActionType(ActionType actionType) {
        this.actionType = actionType;
    }

    @OneToMany(mappedBy = "actionRecord")
    public List<BehaviorRecord> getBehaviorRecordList() {
        return behaviorRecordList;
    }
    public void setBehaviorRecordList(List<BehaviorRecord> behaviorRecordList) {
        this.behaviorRecordList = behaviorRecordList;
    }

    @Id
    @Column(name = "action_record_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getActionRecordId() {
        return actionRecordId;
    }

    public void setActionRecordId(int actionRecordId) {
        this.actionRecordId = actionRecordId;
    }

    @Basic
    @Column(name = "action_date", nullable = true)
    public Date getActionDate() {
        return actionDate;
    }

    public void setActionDate(Date actionDate) {
        this.actionDate = actionDate;
    }

    @Basic
    @Column(name = "action_detail", nullable = true, length = 200)
    public String getActionDetail() {
        return actionDetail;
    }

    public void setActionDetail(String actionDetail) {
        this.actionDetail = actionDetail;
    }

    @Basic
    @Column(name = "is_contact", nullable = true)
    public Integer getIsContact() {
        return isContact;
    }

    public void setIsContact(Integer isContact) {
        this.isContact = isContact;
    }

    @Basic
    @Column(name = "next_contact_time", nullable = true)
    public Date getNextContactTime() {
        return nextContactTime;
    }

    public void setNextContactTime(Date nextContactTime) {
        this.nextContactTime = nextContactTime;
    }

    @Basic
    @Column(name = "about_document", nullable = true, length = 100)
    public String getAboutDocument() {
        return aboutDocument;
    }

    public void setAboutDocument(String aboutDocument) {
        this.aboutDocument = aboutDocument;
    }

    @Basic
    @Column(name = "remarks", nullable = true, length = 200)
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Basic
    @Column(name = "others_record", nullable = true, length = 200)
    public String getOthersRecord() {
        return othersRecord;
    }

    public void setOthersRecord(String othersRecord) {
        this.othersRecord = othersRecord;
    }

    @Basic
    @Column(name = "zan", nullable = true)
    public Integer getZan() {
        return zan;
    }

    public void setZan(Integer zan) {
        this.zan = zan;
    }

    @Basic
    @Column(name = "oppo_id", nullable = true)
    public Integer getOppoId() {
        return oppoId;
    }

    public void setOppoId(Integer oppoId) {
        this.oppoId = oppoId;
    }
}
